package org.example;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @AUTHOR 尹书岿
 * @DATE 2024/12/9 16:31
 * @DESCRIBE
 */
public class Collection {
    public static void main(String[] args) {
//        List<Point> list = new ArrayList<>();
//        Point p1 = new Point(1,1);
//        list.add(p1);
//        Point p2 = new Point(1,2);
//        list.add(p2);
//        for (Point s : list) {
//            System.out.println(s);
//        }

        //删除
//        list.remove(0);
//        System.out.println(list);

        //清空
//        list.clear();

        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        System.out.println(list.size());
        //判断是否存在
        System.out.println(list.contains(2)); //true

        //修改
        list.set(0,4); //423

        //排序
        Collections.sort(list);//234

        System.out.println(list);

    }
}
